-
Notifications
You must be signed in to change notification settings - Fork 224
fix: do not output warning when resolving a configuration #2892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Chris Laprun <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure which solution is better for this problem, but if this would go in there are a few points.
void test() { | ||
final var service = new BaseConfigurationService(); | ||
final var config = service.getConfigurationFor(new NoDepReconciler()); | ||
System.out.println(config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should be asserting the logged message or removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, this wasn't supposed to end up in the commit… 😅
I thought about asserting the lack of logging but this would require changing the architecture (i.e. make the logger an instance variable instead of a class one) just for the tests so decided against it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if is does not test anything, should we remove the test?
* prevent automated, on-demand creation of a reconciler's configuration, please use the | ||
* {@link AbstractConfigurationService} implementation instead as base for your extension. | ||
*/ | ||
@Deprecated(forRemoval = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat strange to introduce a new usage of the method and deprecate it at the same time. How will this be handled when this method is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation uses the method but the documentation explains what should happen instead. It's only deprecated to avoid API breakage in case implementations use it but this method should really be removed, because, as far as I'm aware, there is no implementation that doesn't currently return true
and the creation scenario should only be confined to this particular implementation (or its subclasses) anyway.
"Configuration for reconciler '{}' was not found. {}", | ||
reconcilerKey, | ||
reconcilersNameMessage); | ||
if (!createIfNeeded()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the probelm we are solving this method evetually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean in quarkus operator sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, the issue is preserving the possibility to log (or do something else, if needed) if the configuration doesn't exist in the abstract class, without logging when the configuration is created in BaseConfigurationService
. Removing the logging and createIfNeeded
methods would be API breaking changes so the goal is to have an implementation that doesn't break the existing API and doesn't log a warning when a configuration is created on-demand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, approved
Signed-off-by: Chris Laprun <[email protected]>
Signed-off-by: Chris Laprun [email protected]